﻿@model AutomatedTestDataManagement.Models.SitesPage

@{
    ViewBag.Title = "Delete";
}

<h2>Remove Page from Site</h2>

<h3>Are you sure you want to remove @Model.Page.PageName from @Model.Site.SiteName?</h3>
<fieldset>
    <legend>SitesPage</legend>

    <div class="display-label">
         @Html.LabelFor(model => model.Site.SiteName, "Site")
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Site.SiteName)
    </div>

    <div class="display-label">
         @Html.LabelFor(model => model.Page.PageName, "Page")
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Page.PageName)
    </div>
</fieldset>
@using (Html.BeginForm()) {
    <p>
        <input type="hidden" name="ReturnToView" id="ReturnToView" value="@ViewBag.ReturnToView" />
        @if (ViewBag.SelectedSiteID != null)
        {
            <input type="hidden" name="SelectedSiteID" id="SelectedSiteID" value="@ViewBag.SelectedSiteID" />
        }
        <input type="submit" value="Delete" /> 
        @if (ViewBag.SelectedSiteID != null)
        {
            if (ViewBag.ReturnToView == "Edit")
            {
                @Html.ActionLink("Return to Site", "Edit", "Site", new { id = ViewBag.SelectedSiteID }, null)
            }
            else
            {
                @Html.ActionLink("Return  to Site", "Delete", "Site", new { id = ViewBag.SelectedSiteID }, null)
            }
        }
        @if (ViewBag.PageID != null)
        {
            <input type="hidden" name="PageID" id="PageID" value="@ViewBag.PageID" />
            @Html.ActionLink("Return to Page", "Delete", "Page", new { id = ViewBag.PageID }, null)
        }
    </p>
}
<div>
    @Html.Partial("_NavigationManagementNav")
</div>